package com.shop.cereshop.commons.domain.buyer;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;

import java.io.Serializable;

/**
 * @description: 用户黑名单实体类
 * @author zdd
 * @date 2025/11/12 16:14
 * @version 1.0
 */
@ApiModel(value = "BuyerUserBlacklist", description = "用户黑名单实体类")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("cere_buyer_user_blacklist")
public class BuyerUserBlacklist implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "主键ID")
    private Long id;

    @ApiModelProperty(value = "用户ID（拉黑发起方）")
    private Long buyerUserId;

    @ApiModelProperty(value = "被拉黑的用户ID")
    private Long blockedUserId;

    @ApiModelProperty(value = "关系类型：1-用户拉黑用户 2-系统拉黑用户 3-店铺拉黑用户")
    private Integer relationType;

    @ApiModelProperty(value = "拉黑来源：1-手动拉黑 2-自动拉黑 3-系统操作")
    private Integer blockSource;

    @ApiModelProperty(value = "拉黑场景：0-拉黑 1-我不看他")
    private Integer blockScene;

//    @ApiModelProperty(value = "拉黑原因描述")
//    private String reason;

    @ApiModelProperty(value = "状态：1-有效 0-已解除 -1-已过期")
    private Integer status;

    @ApiModelProperty(value = "拉黑级别：1-轻度 2-中度 3-重度")
    private Integer blockLevel;

    @ApiModelProperty(value = "过期时间")
    private LocalDateTime expireTime;

    @ApiModelProperty(value = "是否自动解封：1-是 0-否")
    private Integer autoUnblock;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createdTime;

    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updatedTime;

    @ApiModelProperty(value = "创建人")
    private Long createdBy;

    @ApiModelProperty(value = "更新人")
    private Long updatedBy;

    // 关联查询字段
    @TableField(exist = false)
    @ApiModelProperty(value = "被拉黑用户名称")
    private String blockedUserName;

    @TableField(exist = false)
    @ApiModelProperty(value = "被拉黑用户头像")
    private String blockedUserAvatar;

    @TableField(exist = false)
    @ApiModelProperty(value = "拉黑发起用户名称")
    private String userName;

    @TableField(exist = false)
    @ApiModelProperty(value = "剩余天数（计算字段）")
    private Integer remainingDays;

}
